﻿// -----------------------------------------------------------------------
// <copyright file="TaskAttribute.cs" company="The Usual Dosage">
// © 2013 by Matthew M. Martin
// </copyright>
// -----------------------------------------------------------------------

namespace Cadence.NET.Attributes
{
    using System;

    /// <summary>
    /// Defines how and when notifications are triggered.
    /// </summary>
    public class NotificationBehavior : Attribute
    {
        /// <summary>
        /// Defines severity of errors
        /// </summary>
        public enum NotifyMethod
        {
            /// <summary>
            /// Send an email to the configured email server
            /// </summary>
            Email,
            /// <summary>
            /// pushover.net
            /// </summary>
            Pushover
        }

        /// <summary>
        /// Type of event that is being passed to the notification manager
        /// </summary>
        public enum NotifyEvent
        {
            /// <summary>
            /// Task is starting
            /// </summary>
            TaskStart,
            /// <summary>
            /// Task has stopped
            /// </summary>
            TaskStop,
            /// <summary>
            /// Task threw exception
            /// </summary>
            TaskError
        }

        /// <summary>
        /// Gets or sets a value indicating whether [notify on error].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [notify on error]; otherwise, <c>false</c>.
        /// </value>
        public bool NotifyOnTaskError { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether [notify on complete].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [notify on complete]; otherwise, <c>false</c>.
        /// </value>
        public bool NotifyOnTaskComplete { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether [notify on start].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [notify on start]; otherwise, <c>false</c>.
        /// </value>
        public bool NotifyOnTaskStart { get; set; }

        /// <summary>
        /// Gets or sets the notify method.
        /// </summary>
        /// <value>
        /// The notify method.
        /// </value>
        public NotifyMethod[] NotificationMethods { get; set; }
    }
}
